<template>
  <div id="app">
    <router-view/>
  </div>
</template>

<script>
import $ from 'jquery'

export default {
  data () {
    return {
    }
  },
  created () {
  },
  mounted () {
    this.selfAdaption()
  },
  methods: {
    selfAdaption(){
      this.windowHeight = document.documentElement.clientHeight
      this.windowWidth = document.documentElement.clientWidth
      let heightScale = this.windowHeight/1080
      let widthScale = this.windowWidth/1920
      $('body').css({
        "transform": `scale(${widthScale},${heightScale})`,
        "-ms-transform": `scale(${widthScale},${heightScale})`,
        "-webkit-transform": `scale(${widthScale},${heightScale})`,
      })
      window.onresize = ()=>{
        return (()=>{
          this.windowHeight = document.documentElement.clientHeight
          this.windowWidth = document.documentElement.clientWidth
          let heightScale = this.windowHeight / 1080
          let widthScale = this.windowWidth / 1920
          $('body').css({
            "transform": `scale(${widthScale},${heightScale})`,
            "-ms-transform": `scale(${widthScale},${heightScale})`,
            "-webkit-transform": `scale(${widthScale},${heightScale})`,
          })
        })()
      }
      //console.log(this.windowHeight,this.windowWidth);
    },
  },
  beforeDestroy () {
  }
}
</script>

<style lang="less">
@import "./assets/style/common.css";

@font-face {
  font-family: 'YouSheBiaoTiHei';
  src: url("./assets/font/YouSheBiaoTiHei-2.ttf");
}
html,body,#app{
  width: 1920px;
  height: 1080px;
  overflow: hidden;
}
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #FFFFFF;
  //background-image: url("./assets/img/bg.png");
}
body{
  transform: scale(1,1);
  -ms-transform: scale(1,1); /* IE 9 */
  -webkit-transform: scale(1,1); /* Safari and Chrome */
  /*transform: scale(0.442188, 0.604167);*/
  transform-origin: left top;
  user-select: none;
}
</style>
